<#assign module="driver"/>

<@override name="header">
<link rel="stylesheet" href="${ctx}/assets/css/datetimepicker.css">
</@override>
<@override name="body">

	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-default" style="height: 32px;" >
				<div class="panel-heading">
					推广历史列表
			    </div>
<#--				<div class="panel-body">-->
<#--					<form class="form-inline"  id="SearchForm" method="get">-->
<#--					    <div class="form-group">-->
<#--			                <input class="form-control" id="startTime" name="startTime" placeholder="开始时间" readonly="readonly" type="text" value="">-->
<#--			            </div>-->
<#--			            <div class="form-group">-->
<#--			                <input class="form-control" id="endTime" name="endTime" placeholder="结束时间" readonly="readonly" type="text" value="">-->
<#--			            </div>-->
<#--			            <div class="form-group">-->
<#--			                <input type="submit" class="btn btn-default" value="查询">-->
<#--			            </div>-->
<#--			            <div class="form-group">-->
<#--			            	<button type="button" class="pull-right btn btn-primary" onclick="window.location='${ctx}/driver/paymentsExport/${driver.id}';"><i class="glyphicon glyphicon-save"></i>&nbsp;导出记录</button>-->
<#--						</div>-->
<#--					</form>-->
<#--				</div>-->
			</div>
	    </div>
    </div>

	<div class="row">
		<div class="col-xs-12">
		<div class="panel panel-primary">
		<div class="table-responsive">
			<table class="table table-hover table-striped" >
				<thead>
				<tr style="font-size:14px;">
					<th style="text-align: center">时间</th>
					<th style="text-align: center">推荐人</th>
					<th style="text-align: center">被推荐人电话</th>
					<th style="text-align: center">推广奖励变动（元）</th>
					<th style="text-align: center">备注</th>

				</tr>
				</thead>
				<tbody>
					<#if (page.content)?? >
				  	<#list page.content as data>
						<tr>
							<td style="text-align: center">${data.created?string("yyyy-MM-dd HH:mm:ss")}</td>
							<td style="text-align: center">${driver.name?if_exists}</td>
							<td style="text-align: center">${data.passengerPhone?if_exists}</td>
							<#if data.money gt 0>
								<td style="color:#00EC00; text-align:center;">${data.money?if_exists}</td>
							<#else>
								<td style="color:red; text-align:center;">${data.money?if_exists}</td>
							</#if>
							<td style="text-align: center">${data.memo?if_exists}</td>
						</tr>
					</#list>
					</#if>
				</tbody>
			</table>
			<#if page.totalElements??>
			<ul class="pagination pull-right pagination-sm">
				<li><a>共 ${page.totalElements} 条数据</a></li>
				<@pg.pager items=page.totalElements?number maxPageItems=20 export="currentPageNumber=pageNumber" url="${ctx}/driver/extendDetail/${driver.id}">
					<@pg.param name="startTime" value="${start?string('yyyy-MM-dd')}"/>
					<@pg.param name="endTime" value="${end?string('yyyy-MM-dd')}"/>
					<@pg.index>
						<@pg.first>
							<li><a href="${pageUrl}">&laquo;</a></li>
						</@pg.first>
						<@pg.prev>
							<li><a href="${pageUrl}">&lsaquo;</a></li>
						</@pg.prev>
						<@pg.pages>
							<#if  currentPageNumber == pageNumber >
								<li class="active"><a href="#">${pageNumber}</a></li>
							<#else>
								<li><a href="${pageUrl}">${pageNumber}</a></li>
							</#if>
						</@pg.pages>
						<@pg.next>
							<li><a href="${pageUrl}">&rsaquo;</a></li>
						</@pg.next>
						<@pg.last>
							<li><a href="${pageUrl}">&raquo;</a></li>
						</@pg.last>
					</@pg.index>
				</@pg.pager>
			</ul>
			</#if>
		</div>
		</div>
		</div>
	</div>


</@override>
<@override name="footer">
<script src="${ctx}/assets/js/bootstrap-datetimepicker.min.js"></script>
<script src="${ctx}/assets/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#startTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true });
		$("#endTime").datetimepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', minView: 'month', pickDate: true, pickTime: false, inputMask: false, autoclose: true });

	});
</script>
</@override>
<@extends name="../layout.ftl"/>